//@ sourceURL=MeetInformationView.js
Ext.ns("MeetInformationView");
MeetInformationView = Ext.extend(Ext.Panel, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        MeetInformationView.superclass.constructor.call(this, {
            id : "MeetInformationView",
            title : "会议资讯",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
        var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'MeetInformationForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "会议名称"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_meetName_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "会议资讯列表",
                rowActions:true,
                listUrl : __ctxPath + "/safemeeting/listMeetInformation.do",
                removeUrl : __ctxPath + "/safemeeting/deleteMeetInformation.do",
                fields : [ "id", "years", "institution","situationNo", "meetName", "meetTheme", "participants"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                }, {
                    header : "年份",
                    dataIndex : "years",
                    width : 50,
                    hidden : true,
                    sortable : true
                }, {
                    header : "所属机构",
                    dataIndex : "institution",
                    width : 80
                }, {
                    header : "参会情况",
                    dataIndex : "id",
                    sortable : true,
                    width:70,
                    renderer : function(j, i, g, m, h) {
                        var id = g.data.id;
                        var buttons = "";
                        if (id != -1) {
                            if (isGranted("_MeetInformationEdit")) {
                                buttons += '<a href="#" onclick="MeetInformationView.edit(' + id + ')">参会情况</a>';
                            }
                        }
                        return buttons;
                    }
                }, {
                    header : "会议名称",
                    dataIndex : "meetName",
                    width : 80
                }, {
                    header : "会议主题",
                    dataIndex : "meetTheme",
                    width : 80
                }, {
                    header : "参会人员",
                    dataIndex : "participants",
                    width : 100
                } ]
            },
            tree : {
                treeUrl : __ctxPath + "/safemeeting/treeLoadMeetInformation.do"
            }
            
        });
        return yearGridComponents;
    }
});
MeetInformationView.edit = function(id) {
    new MeetInforSituationForm({
        id : id,
        operation: Constant.Operation.EDIT
    }).show();
};
